package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.TExamPackage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TPackageCategoryMapper;
import com.ruoyi.system.domain.TPackageCategory;
import com.ruoyi.system.service.ITPackageCategoryService;

/**
 * 套餐类型分类Service业务层处理
 *
 * @author ruoyi
 * @date 2025-06-26
 */
@Service
public class TPackageCategoryServiceImpl implements ITPackageCategoryService {
    @Autowired
    private TPackageCategoryMapper tPackageCategoryMapper;

    /**
     * 查询套餐类型分类
     *
     * @param id 套餐类型分类主键
     * @return 套餐类型分类
     */
    @Override
    public TPackageCategory selectTPackageCategoryById(Long id) {
        return tPackageCategoryMapper.selectTPackageCategoryById(id);
    }

    /**
     * 查询套餐类型分类列表
     *
     * @param tPackageCategory 套餐类型分类
     * @return 套餐类型分类
     */
    @Override
    public List<TPackageCategory> selectTPackageCategoryList(TPackageCategory tPackageCategory) {
        return tPackageCategoryMapper.selectTPackageCategoryList(tPackageCategory);
    }

    /**
     * 新增套餐类型分类
     *
     * @param tPackageCategory 套餐类型分类
     * @return 结果
     */
    @Override
    public int insertTPackageCategory(TPackageCategory tPackageCategory) {
        tPackageCategory.setCreateTime(DateUtils.getNowDate());
        return tPackageCategoryMapper.insertTPackageCategory(tPackageCategory);
    }

    /**
     * 修改套餐类型分类
     *
     * @param tPackageCategory 套餐类型分类
     * @return 结果
     */
    @Override
    public int updateTPackageCategory(TPackageCategory tPackageCategory) {
        tPackageCategory.setUpdateTime(DateUtils.getNowDate());
        return tPackageCategoryMapper.updateTPackageCategory(tPackageCategory);
    }

    /**
     * 批量删除套餐类型分类
     *
     * @param ids 需要删除的套餐类型分类主键
     * @return 结果
     */
    @Override
    public int deleteTPackageCategoryByIds(Long[] ids) {
        return tPackageCategoryMapper.deleteTPackageCategoryByIds(ids);
    }

    /**
     * 删除套餐类型分类信息
     *
     * @param id 套餐类型分类主键
     * @return 结果
     */
    @Override
    public int deleteTPackageCategoryById(Long id) {
        return tPackageCategoryMapper.deleteTPackageCategoryById(id);
    }

    @Override
    public List<TExamPackage> getallpackage() {
        return tPackageCategoryMapper.getallpackage();
    }
    @Override
    public List<String> getpackagebyname(String name) {
        return tPackageCategoryMapper.getpackagebyname(name);
    }
}
